<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>2350300097 万朗</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    String teacherName=(String)session.getAttribute("teacherName");
    String className=(String)session.getAttribute("className");
    String courseNum=(String)session.getAttribute("courseNum");
    String studentNum=(String)session.getAttribute("studentNum");
    int cn=Integer.parseInt(courseNum);
    int sn=Integer.parseInt(studentNum);

    String courseName[]=new String[cn];
    for(int i=0;i<cn;i++){
        courseName[i]=request.getParameter("courseName["+i+"]");
    }

    session.setAttribute("courseName", courseName);
%>
<p align="center"><strong><font size="5">请输入学生姓名和各科成绩</font></strong></p>
<hr width="600">
<p align="center">
    <strong>
        老师姓名：<%=teacherName %>&nbsp;&nbsp;
        班级名称：<%=className %>&nbsp;&nbsp;
        科目数：<%=courseNum %>&nbsp;&nbsp;
        学生人数：<%=studentNum %>
    </strong>
</p>

<form name="form1" method="post" action="j4.jsp">
    <table border="1" align="center" cellpadding="2" cellspacing="0">
        <tr>
            <td align="center"><strong>学生姓名</strong></td>
            <%for(int i=0;i<cn;i++){ %>
            <td align="center"><strong><font color="#FF0000"><%=courseName[i] %></font>成绩</strong></td>
            <%} %>
        </tr>
        <%for(int i=0;i<sn;i++){ %>
        <tr>
            <td align="center"><input name="<%= "studentName["+i+"]" %>" type="text" size="8">
            </td>
            <%for(int j=0;j<cn;j++){ %>
            <td align="center"><input name="<%= "score["+i+"]["+j+"]" %>" type="text" size="8">
            </td>
            <%} %>
        </tr>
        <%} %>
    </table>
    <p align="center">
        <input type="submit" name="Submit" value="提交信息">
        <input type="reset" name="Submit2" value="重新填写">
    </p>
</form>
<p>&nbsp;</p>
</body>
</html>